<?php

class RegisterfreeModule extends CWebModule {

    public $layoutPath = '';

    public function init() {
        // this method is called when the module is being created
        // you may place code here to customize the module or the application
        // import the module-level models and components
        $this->setImport(array(
          'registerfree.models.*',
          'registerfree.components.*',
        ));
    }

    public function beforeControllerAction($controller, $action) {
        if (parent::beforeControllerAction($controller, $action)) {
            if ($this->layoutPath == '') {
                $this->layoutPath = Yii::getPathOfAlias('application.views.layouts');
            }

            $this->setLayoutPath($this->layoutPath);
            return true;
        } else
            return false;
    }

}
